<?php
	 /*******Start Paging*****************************/
	$page = $_GET['page'];				
	$limit = $display; 
	$total = count($data); 
	// work out the pager values 
	$pager  = Pager::getPagerData($total, $limit, $page); 
	$offset = $pager->offset; 
	$limit  = $pager->limit; 
	$page   = $pager->page;
	/*******Break paging*******************************/
                
?>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
	for($i=$offset;$i<$offset+$limit && $data[$i]!="";)
	{
?>
                        <tr>
<?php
		for($j=0;$j<3;$j++)
		{
?>
                          <td width="33%" align="center">
<?php
			if($i<$offset+$limit && $data[$i]!="")
			{
?>
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td align="center"><a href="?menu=<?php echo $menuid?>&type=detail&id=<?php echo $data[$i]['WallpaperID']?>"><img src="file/gallery/<?php echo $data[$i]['WallpaperID']?>/thumbs200/<?php echo $data[$i]['Image']?>" width="220" border="0"></a></td>
                                </tr>
                                <tr>
                                  <td height="25" align="center"><a href="?menu=<?php echo $menuid?>&type=detail&id=<?php echo $data[$i]['WallpaperID']?>" class="main_news_tieude"><?php echo $data[$i]['WallpaperName']?></a></td>
                                </tr>
                              </table>
<?php
			}
?>
                          </td>

<?php
			$i++;
		}
?>
                        <tr>
                          <td colspan="3" align="center">&nbsp;</td>
                        </tr>                    
<?php
	}
?>                        
                        
<?php
	if($paging)
	{
?>
                        <tr>
                          <td height="30" colspan="3" align="center">
                          <?php
                          include("module/common/pagination.php");
						  ?>
                          </td>
                        </tr>

<?php
	}
?>                   
                      </table>